package cn.edu.fudan.autoparser;

public class AutoHTMLParserFactory {
	public static AutoHTMLParser newInstance(String basicURL,String subURL) throws Exception{
		AutoHTMLParser autoHTMLParser=null;
		if(basicURL.contains("qq.com")){
			autoHTMLParser=new QQAutoHTMLParser(basicURL, subURL);
		} else if(basicURL.contains("163.com")){
			autoHTMLParser=new NetEaseAutoHTMLParser(basicURL, subURL);
		}else if(basicURL.contains("bitauto.com")){
			autoHTMLParser=new BitAutoHTMLParser(basicURL, subURL);
		}else if(basicURL.contains("xcar.com")){
			autoHTMLParser=new XCarAutoHTMLParser(basicURL, subURL);
		}else if(basicURL.contains("ifeng.com")){
			autoHTMLParser=new IFengAutoHTMLParser(basicURL, subURL);
		}else {
			throw new Exception("Undefined Parser for home: "+basicURL);
		}
		return autoHTMLParser;
	}

}
